import {ByteRange_Pro} from "@/utils/utils"

export const addSchema: FormSchema = {
    "style": {
        "width": "auto"
    },
    "formItemLayout": {
        "labelCol": {
            "span": 6
        },
        "wrapperCol": {
            "span": 18
        }
    },
    "formItem": [
        {
          key: 'type',
          value: 0,
          hidden: true
        },
        {
            "type": "input",
            "label": "策略名称",
            "key": "name",
            "value": "",
            "props": {
                "placeholder": "策略名称"
            },
            "rules": [
                {
                    "required": true,
                    "message": "策略名称不能为空"
                }
            ]
        },
        {
            "type": "input",
            "label": "进程名",
            "key": "processname",
            "value": "",
            "props": {
                "placeholder": "进程名"
            },
            "rules":[
                {
                    "validator":(rule,value,callback)=>{return ByteRange_Pro(rule,value,callback,64)},
                    "message": "进程名称最多64个字节"
                }
            ]
        },
        {
            "type": "input",
            "label": "文件目录",
            "key": "documentname",
            "value": "",
            "props": {
                "placeholder": "文件目录"
            },
            "rules": [
                {
                    "required": true,
                    "message": "文件目录不能为空"
                },
                {
                    "validator":(rule,value,callback)=>{return ByteRange_Pro(rule,value,callback,256)},
                    "message": "文件目录最多256个字节"
                }
            ]
        },
        {
            "type": "select",
            "label": "安全标记",
            "key": "safemark",
            "value": 1,
            "options": [
                {
                    "value": 1,
                    "label": "高级"
                },
                {
                    "value": 3,
                    "label": "低级"
                }
            ]
        },
        {
            "type": "select",
            "label": "完整性标记",
            "key": "completemark",
            "value": 1,
            "options": [
                {
                    "value": 1,
                    "label": "高级"
                },
                {
                    "value": 3,
                    "label": "低级"
                }
            ]
        }
    ]
}
